<html xml:lang="tr" lang="tr" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>SAYIM</title>
<meta http-equiv="content-type" contentType="text/html; charset=UTF-8">
<link rel="stylesheet" href="./static/css/reset.css" />
<script src="../static/jquery.js"></script>
<script src="../static/js/jquery-ui.js"></script>
<script src="./static/js/datetimepicker.js"></script>
<script type="text/javascript"
	src="./static/js/jquery.maskedinput.min.js"></script>
<script src="../static/js/jquery.form.min.js"></script>
<script src="../static/js/jquery.handsontable.full.js"></script>
<script src="./static/js/jquery.blockUI.js"></script>
<script src="./static/js/jquery.cookie.js"></script>
<script src="../static/js/hintbox.js"></script>
<link rel="stylesheet" href="./static/css/hintbox.css" />
<link rel="stylesheet"
	href="./static/js/themes/smoothness/jquery-ui.css" />
<link rel="stylesheet"
	href="./static/css/jquery.handsontable.full.css" />
<script src="{{url_for('static', filename='js/jquery.tablesorter.min.js')}}"></script>
<link rel="stylesheet"
	href="{{url_for('static', filename='css/table2.css')}}" type="text/css"
	id="" media="print, projection, screen">

<style type="text/css">
body {
	margin: 0px auto;
	padding: 0px 0px;
	font-family: calibri;
	
}
.anasablon {
	width: auto;
	height: auto;
	
}
.mheader {
	font-family: Arial, Verdana;
	text-shadow: 2px 2px 2px #ccc;
	display: block;
	float: left;
	font-weight: bold;
	padding-left: 10px;
	text-align: left;
	font-size: 15px;
	width: 1300px;
	height: 20px;
}
.formalan{
	float:left;
	width:400px;
	height:500px;
	border:#CCC solid 1px;
	background-color:#669999 ;
	margin-right: 10px;
	margin-left: 4px;
	font-family:monospace;
	font-weight: bold;
}
.raporalan{
	width:1050px;
	height:650px;
	overflow: scroll;
}
.genelalan {
	float: right;
	width: 1050px;
	height: 670;
	background-color:#669999 ;
}
.operbutonlar{
	width:auto; 
	margin: 5 ;
	font-family:monospace;
	font-weight: bold;
}
.element{
	width:360px; 
	margin: 10 ;
	float:center;
	font-family:monospace;
	font-weight: bold;
}
p{ 
	margin:5px 0; 
}
hr {
	top:5px; 
	width: 100%;
	clear: both;
	margin: auto;
}

.mheader,.formalan,.raporalan{
	margin: 3px;
	padding: 15px;
	background-color:#669999 ;
	border: 1px solid #cccccc;
	-moz-border-radius: 6px;
	-webkit-border-radius: 6px;
	border-radius: 6px;
	-moz-box-shadow: 2px 2px 2px #cccccc;
	-webkit-box-shadow: 2px 2px 2px #cccccc;
	box-shadow: 2px 2px 2px #cccccc;
}
</style>
<script>

	var stoklar=[];
	var stix = 0;
	
	$(function(){
	    var $hello= $('[id$="fkod"]');

	    $hello.on("change", function(){ //bind() for older jquery version
	        stokSorguCa();
	    }).triggerHandler('change'); //could be change() or trigger('change')
	});
	
	$(document).ready(function() {
	
		$('#miktar').keypress(function(event){return event.keyCode != 13;});
		
		$('#yeniStk').on('click', function(event){
			event.preventDefault();
			var formOption = {
				url				: "/yeniSTkHarList",
				type			: "POST",
				success			: yeniSTkHarList
			};
			$('#sayimForm').ajaxSubmit(formOption);
		});
		
		$('#kod').keypress(function(event){return event.keyCode != 13;});
		$('#ad').keypress(function(event){return event.keyCode != 13;});
		
		$("#ad").autocomplete({
			source : "/addanStokAra",
			type: "POST",
			minLength : 3,
			remoteDataType : 'json',
			autoFill : true,
			select : secilenStokuGetir
		});
		
		
		$("#sayimCari").autocomplete({
			source : "/cariBul",
			type: "POST",
			minLength : 2,
			remoteDataType : 'json',
			autoFill : true,
			//select : cariIliskiDok
		});
		
		$("#satisCari").autocomplete({
			source : "/cariBul",
			type: "POST",
			minLength : 2,
			remoteDataType : 'json',
			autoFill : true,
			//select : cariIliskiDok
		});
		
		$('#datfiat').on('blur', function(event){
			var opStkHar = {
				url: "/stkEkle",
				type: "post",
				target: "#raporalan",
				dataType: "json",
				beforeSubmit : stkKayitKontrol,
				success : stkBilgiGetir
			};
			$("#sayimForm").ajaxSubmit(opStkHar); 
		});
		
		$('#stkSatirSil').on('click', function(event){
			event.preventDefault();
			var formOption = {
				url				: "/stkSatirSil",
				type			: "POST",
				target			:"#raporalan",
				success			: stkBilgiGetir,
				beforeSubmit 	: kontrolStkSatirSil
			};
			$('#sayimForm').ajaxSubmit(formOption);
		});
		
		$('#shSifirlama').on('click', function(event){
			event.preventDefault();
			var stkno=$('#stklist').val();
			$.ajax({
				url : "/shSifirlama?stkno="+stkno+"&carikod="+$("#sayimCari").val().split('@')[1]+"&caribag="+$("#satisCari").val().split('@')[1],
			}).done(function(data) {
				succesHandler(data);	
			});
		});
		
		$('#guncelsira').on('change', function(event){
			$.ajax({
				url : "/stkHarAl?guncelsira=" +$("#guncelsira").val(),
			}).done(function(dataSatir) {
				if (dataSatir != "") {
					$('#kod').val(dataSatir[0]);
					$('#ad').val(dataSatir[1]);
					$('#miktar').val(dataSatir[2]);
					$('#datfiat').val(dataSatir[3]);
				} else {
					$('#kod').val("");
					$('#ad').val("");
					$('#miktar').val("");
					$('#datfiat').val("");
				}	
			});
		});
		
		$('#sayimTarih').datepicker({
			dateFormat: 'dd-mm-yy',
			dayNamesMin: [ "Pz", "Pt", "Sa", "Ca", "Pe", "Cu", "Ct" ],
			monthNames: [ "Ocak", "Subat", "Mart", "Nisan", "Mayis", "Haziran", "Temmuz", "Agustos", "Eylul", "Ekim", "Kasim", "Aralik" ],
			duration: 1,
			firstDay: 1,
			minDate: new Date(2018, 0, 1),
			maxDate: new Date(2019, 11, 31),
		}).mask('99-99-9999');
		
		$('#kod').keypress(function(event){
			if(event.keyCode ==13 || event.keyCode ==9){
				$.ajax({
						url : "/stokNesneGetir?kriter=kod&stokod=" + $('#kod').val(),
				}).done(function(data) {
					if(data && data !=""){
						$('#bilgi').html("");
						stokBilgiDoldur(data);
						$("#miktar").focus();
						stokBakiyeBilgi();
					}else{
						$('#bilgi').html("stok bulunamadi.");
						stokBilgiBosalt();
					}
				});
			}
		});
		
		$('#sayimHazirla').on('click', function(event){
			event.preventDefault();
			var opgetir = {
					url: "/sayimHazirla",
					DataType : 'json',
					type: "POST",	
					beforeSubmit 	: kontrolSayimHazirla,
					success: function (data) {
						if(data=='tamam'){
							islemTamam("Sayım Hazırlandı.");
						}else{
							hataGoster(data);
						}
					}
			};
			$('#sayimForm').ajaxSubmit(opgetir);
		});
		
		$('#sayimIslet').on('click', function(event){
			event.preventDefault();
			var opgetir = {
					url: "/sayimIslet",
					DataType : 'json',
					type: "POST",	
					success: function (data) {
						if(data=='tamam'){
							islemTamam("Sayım İşlendi.");
						}else{
							hataGoster(data);
						}
					}
			};
			$('#sayimForm').ajaxSubmit(opgetir);
		});
		
		$('#stokSifirla').on('click', function(event){
			event.preventDefault();
			var opgetir = {
					url: "/stokSifirla",
					DataType : 'json',
					type: "POST",	
					beforeSubmit : function () {
						if($('#sayimTarih').val()=='' || $('#sayimCari').val()==''){
							hataGoster("tarih veya sayim yeri boş olamaz!");
							return false;
						}else{
							return true;
						}
					},
					success: function (data) {
						if(data=='tamam'){
							islemTamam("İlgili Stoklar Sıfırlandı.");
						}else{
							hataGoster(data);
						}
					}
			};
			$('#sayimForm').ajaxSubmit(opgetir);
		});
		
		$('#stklist').on('change', function(event){
			$('#stksecim').val("sayimstk");
			stkYenile();
		});
		
		$('#dosYukle').on('click', function(event){
			event.preventDefault();
			var opgetir = {
				url: "/dosYukle",
				DataType : 'json',
				type: "POST",	
				success: function (data, status) {
					islemTamam(data);
				}
			};
			$('#sayimForm').ajaxSubmit(opgetir);
		});
		
		$("#raporalan").click(function(event){
		    //event.preventDefault();
			event = event || window.event;
			console.log(event);
	         if(event.target.id !='sisLink')
	         {
	            event.preventDefault(); 
	         }
			var targ;
		    if (event.target) targ = event.target;
		    else if (event.srcElement) targ = event.srcElement;
		    if (targ.nodeType == 3) // defeat Safari bug
		        targ = targ.parentNode;
			console.log(targ.id);
			var islem=targ.id.split("@");
			var olay=islem[0];
			var islem_no=islem[1];
		    
			if(olay == "stk_yukle"){
				stkYerlestir(islem_no);
			}
			if(olay == "stk_sil"){
				$("#guncelsira").val(islem_no);
				stkSatirSil(islem_no);
			}
		});
		
		$('#stkYenile').on('change', function(event){
			$('#stksecim').val("sayimstk");
			formOption = {
				url		: "/stklistAl",
				type	: "POST",
				dataType: "json",
				success : function (data) {
					$("#stklist").empty();
					for(row in data) {
						tempOpt = new Option(data[0]);
						$("#stklist").append(tempOpt);
					}
				}
			};
			$("#sayimForm").ajaxSubmit(formOption); 
		});
		
		$('#stokSorgu').on('click', function(event){
			event.preventDefault();
			var opgetir = {
					url: "/stokSorgu2",
					//target:"#hareketGozlem",
					DataType : 'json',
					type: "POST",	
					success: hareketGozlemDonus
			};
			$('#sayimForm').ajaxSubmit(opgetir);
		});
		
		$('#caStokSorgu').on('click', function(event){
			stokSorguCa();
		});
		
		$('#sprStokSorgu').on('click', function(event){
			event.preventDefault();
			$.ajax({
				url : "/sprStokSorgu?stkno=" + $('#sprstok').val(),
			}).done(function(data) {
				stokListHazirla(data);
			});
		});
		
		$('#ileri').on('click', function(event){	
			event.preventDefault();
			stix=parseInt($.cookie('stix'));
			console.log(stix);
			$.cookie('stix',stix+1);
			
			diziStokGetir(stix+1);
		});
		
		$('#geri').on('click', function(event){	
			event.preventDefault();
			stix=parseInt($.cookie('stix'));
			console.log(stix);
			$.cookie('stix',stix-1);
			diziStokGetir(stix-1);	
		});
		
		$('#reset').on('click', function(event){	
			event.preventDefault();
			$.cookie('stix',-1);
		});
		
		
	});
	
	function secilenStokuGetir() {
		$.ajax({
			url : "/stokNesneGetir?kriter=ad&stokad=" + $('#ad').val(),
		}).done(function(data) {
			console.log(data)
			stokBilgiDoldur(data);
			stokBakiyeBilgi();
			//$("#stkMiktar").focus();
		});
	}
	
	function kontrolStkSatirSil(formData, jqForm, options) {
		if( $('#stklist').prop('selectedIndex') < 0 ) {
			hataGoster("Lütfen Stok Hareketi Listesi Seçin");
			return false;
		}
		if( $('#guncelsira').val() == "yeni" ) {
			hataGoster("Lütfen Stok Hareketi Seçin");
			return false;
		} 
	}
	
	function stkYenile(){
		formOption = {
			url		: "/stkHarListGetir",
			type	: "POST",
			dataType: "json",
			success : stkBilgiGetir
		};
		$("#sayimForm").ajaxSubmit(formOption); 
	}
	
	function stkSatirSil(stkno){
		//$('#stksira').val(stkno);
		var formOption = {
			url				: "/stkSatirSil",
			type			: "POST",
			target			:"#stkTablo",
			success			: stkYenile
			//beforeSubmit 	: kontrolStkSatirSil
		};
		$('#sayimForm').ajaxSubmit(formOption);
	}
	
	function kontrolSayimHazirla(formData, jqForm, options) { 
		if( $('#stklist').prop("selectedIndex") < 0 ){
			hataGoster("Önce Stok Hareketi oluşturun!");
			$("#ad").empty();
			return false;
		}
		if( $("#sayimCari").val() && $("#sayimTarih").val() ) {
			return true;
		} else {
			hataGoster("Boş sahalar var");
		}
	}
	
	function yeniSTkHarList(res, statusText, xhr, $form) {
		tempOption = new Option(res);
		$(tempOption).attr("selected", true);
		$("#stklist").append(tempOption);
		duzsira = new Option('yeni');
		$(duzsira).attr("selected", true);
		$("#guncelsira").empty();
		$("#guncelsira").append(duzsira);
	}
	
	function stkKayitKontrol(formData, jqForm, options) {
		
		if( $('#stklist').prop("selectedIndex") < 0 ){
			hataGoster("Önce Stok Hareketi oluşturun!");
			$("#ad").empty();
			return false;
		}
		if( $("#kod").val() && $("#ad").val() 
				&& $("#miktar").val() && $("#datfiat").val() ) {
			return true;
		} else {
			hataGoster("Boş sahalar var");
		}
	}
	
	function stkSiraAl(stkno){
		$.ajax({
			url : "/stkSiraAl?stkno=" + stkno,
		}).done(function(data) {
			duzsira = new Option('yeni');
			$(duzsira).attr("selected", true);
			$("#guncelsira").empty();
			$("#guncelsira").append(duzsira);
			for(row in data) {
				tempOpt = new Option(data[row][0]);
				$("#guncelsira").append(tempOpt);
			}
		});	
	}
	
	function otosprHesapla(){
		var nok1spr=0
		var bak1=$('#bak1').val();
		bak1=parseFloat(bak1);
		var sat1=$('#sat1').val();
		sat1=parseFloat(sat1);
		var bak2=$('#bak2').val();
		bak2=parseFloat(bak2);
		var sat2=$('#sat2').val();
		sat2=parseFloat(sat2);
		if(bak1>0 && bak1<sat1){
			nok1spr=sat1-bak1;
		}else{
			nok1spr=sat1;
		}
		var nok2spr=0
		
		if(bak2>0 && bak2<sat2){
			nok2spr=sat2-bak2;
		}else{
			nok2spr=sat2;
		}
		$('#otospr').val(parseFloat(nok1spr)+parseFloat(nok2spr));
		/*console.log(sat1);
		console.log(sat2);
		$('#otospr').val(parseFloat(sat1)+parseFloat(sat2));*/
	}
	
	function stkBilgiGetir(res, statusText, xhr, $form) {
		if(res!='None'){
			stkno=$('#stklist').val();
			$("#raporalan").html("");
			stkSiraAl(stkno);
			stkFsbAl(stkno);
			$("#raporalan").html(res);
			$("#hareketrapor").tablesorter();
			stokBilgiBosalt();
		}
	}
	
	function stokBakiyeBilgi(){
		$.ajax({
			url : "/stokBakiyeGetir?stokod="+$("#kod").val()+"&merkez="+$("#sayimCari").val()
			+"&nokta1="+$("#nokta1").val()+"&nokta2="+$("#nokta2").val(),
		}).done(function(data) {
			stokBakiyeDoldur(data);
			//stokSatisBilgi();
			//$("#stkMiktar").focus();
		});
	}
	
	function stkFsbAl(stkno){
		$.ajax({
			url : "/stkFsbAl?stkno=" + stkno,
		}).done(function(data) {
			$('#fsb').html(data);
		});	
	}
	
	function stokBakiyeDoldur(data){
		$("#bakiye").val(data[0]);
		//$("#bak1").val(data[1]);
		//$("#bak2").val(data[2]);
	}
	
	function stokSatisBilgi(){
		$.ajax({
			url : "/stokSatisGetir?stokod="+$("#kod").val()+"&gerigun="+$("#gerigun").val()
			+"&nokta1="+$("#nokta1").val()+"&nokta2="+$("#nokta2").val(),
		}).done(function(data) {
			stokSatisDoldur(data);
			//$("#stkMiktar").focus();
		});
	}
	
	function stokSatisDoldur(data){
		$("#sat1").val(data[0]);
		$("#sat2").val(data[1]);
		otosprHesapla();
		
	}
	
	function stokBilgiDoldur(data){
		$("#kod").val(data.kod);
		$("#ad").val(data.isim);
		$("#nakdv").val(data.alis_fiat1);
		$("#sat1fiat").val(data.satis_fiat1);
		$("#sat2fiat").val(data.satis_fiat2);
		$("#datfiat").val(data.satis_fiat3);
		$("#barkod1").val(data.barkod1);
		$("#barkod3").val(data.barkod3);
		$("#barkod2").val(data.barkod2);
		$("#alkdv").val(data.aliskdv);
		$("#satkdv").val(data.satiskdv);
		$("#grupkod").val(data.grupkod);
	}
	
	function stokBilgiBosalt(){
		$("#kod").val("");
		$("#ad").val("");
		$("#miktar").val("");
		$("#datfiat").val("");
		$('#kod').focus();
	}
	
	function cariIliskiDok(){
			
		var formOption = {
				url: "/fHareketGozlem",
				type: "POST",	
				//beforeSubmit : hareketGozlemKontrol,
				success: caharGozlemDonus
		};
		$("#sayimForm").ajaxSubmit(formOption); 
	}
	
	function caharGozlemDonus(res,statusText,xhr,$form){
		//$('#hareketGozlem').html(res);
		if(res!='None'){
			$("#raporalan").html(res);
			$("#hareketrapor").tablesorter();
		}
	}
	
	function stokSorguCa(){
		$.ajax({
			url : "/caStokSorgu?fkod=" + $('#fkod').val(),
		}).done(function(data) {
			stokListHazirla(data);
		});
	}
	
	
	
	function diziStokGetir(stix){
		var stokodlar=$.cookie('stoklar').split(',')
		//var stokod=stokodlar[$.cookie('stix')];
		var stokod=stokodlar[stix];
		$.ajax({
			url : "/stokNesneGetir?kriter=kod&stokod=" + stokod,
		}).done(function(data) {
			if(data && data !=""){
					$('#bilgi').html("");
					stokBilgiDoldur(data);
					stokBakiyeBilgi();
			}else{
					$('#bilgi').html("stok bulunamadi.");
					stokBilgiBosalt();
			}
		});

	}
	
	function hareketGozlemDonus(res,statusText,xhr,$form){
		stokListHazirla(res);
	}
	
	function stokListHazirla(dizi){
		if(dizi!='None'){
			var sorgu=[];
			sorgu=dizi;
			var durma=true;
			var say=0;
			var stkod="";
			$.cookie('stix',-1 );
			stoklar=new Array;
			/*while(sorgu[say][0]){
				stkod=sorgu[say][0];
				stoklar.push(stkod);
				//$.cookie('k',stkod );
				console.log(stkod)
				say=say+1;	
				$.cookie('stoklar',stoklar );
			}*/
			
			while(sorgu[say]){
				stkod=sorgu[say];
				stoklar.push(stkod);
				say=say+1;	
				$.cookie('stoklar',stoklar );
			}
			console.log("gelen stok sayi:"+say);
		}
		
	}
	
	function islemTamam(message) {
		// TODO: hata mesajı dön
		$.blockUI({ 
            message: message, 
            fadeIn: 500, 
            fadeOut: 500, 
            timeout: 2000, 
            showOverlay: false, 
            centerY: false, 
            css: { 
                width: '550px',
                top: '6px', 
                left: '', 
                right: '100px', 
                border: 'none', 
                padding: '10px', 
                backgroundColor: '#080', 
                '-webkit-border-radius': '6px', 
                '-moz-border-radius': '6px', 
                'border-radius': '6px',
                opacity: .6, 
            	'font-style': 'italic',
	        	'font-weight': 'normal',
	        	'font-family': 'Georgia, "Times New Roman", Times, serif',
	        	'font-size': '16px',
	        	color: '#fff'
            }
        });
	}
	
	function hataGoster(message) {
		
		console.log("HATA:" + message);
		$.blockUI({ 
            message: message, 
            fadeIn: 500, 
            fadeOut: 500, 
            timeout: 2000, 
            showOverlay: false, 
            centerY: false, 
            css: { 
                width: '550px',
                top: '6px', 
                left: '', 
                right: '100px', 
                border: 'none', 
                padding: '10px', 
                backgroundColor: '#900', 
                '-webkit-border-radius': '6px', 
                '-moz-border-radius': '6px', 
                'border-radius': '6px',
                opacity: .6, 
            	'font-style': 'italic',
	        	'font-weight': 'normal',
	        	'font-family': 'Georgia, "Times New Roman", Times, serif',
	        	'font-size': '16px',
	        	color: '#fff',
                
            }
        });
	}
	
</script>
</head>

<body bgcolor='silver' > 
<div class=anasablon>
	<div class="mheader" tabindex="-1">
		<a href="/sayimModul"><img src="pencil.png" class="hover" hinttext="Sayım" style="margin-right:120px;"></a> 
		<a href="/stokModul"><img src="stok.png" class="hover" hinttext="Stok" style="margin-right:20px;"></a> 
		<a href="/faturaModul"><img src="fatura.png" class="hover" hinttext="Fatura" style="margin-right:20px;"></a> 
		<a href="/cariModul"><img src="cari.png" class="hover" hinttext="Cari" style="margin-right:20px;"></a> 
		<a href="/siparisModul"><img src="spr.png" class="hover" hinttext="Sipariş" style="margin-right:20px;"></a> 
		<a href="/veriModul"><img src="veri.png" class="hover" hinttext="Veri" style="margin-right:20px;"></a> 
		<a href="/raporModul"><img src="rapor.png" class="hover" hinttext="Rapor" style="margin-right:20px;"></a> 
		<a href="/yetkiliModul"><img src="config.png" class="hover" hinttext="Veri" style="margin-right:20px;"></a> 
		<a href="/altyapiModul"><img src="altyapi.png" class="hover" hinttext="Altyapı" style="margin-right:20px;"></a> 
		<a href="/logModul"><img src="log.png" class="hover" hinttext="Log" style="margin-right:20px;"></a> 
		<a href="/exit"><img src="cikis.png" class="hover" hinttext="ÇIKIŞ" style="margin-left:40px;"></a> 
		<div class="kulblok">{{kullanici}}</div>
	</div><br>
	<div class=formalan>
		<div class=element>
			<table  border=1  align=left>
			<form id=sayimForm name=sayimForm action="{{ url_for('sayimModul') }}" method=post enctype="multipart/form-data">
			<tr>
			<td>KOD:</td>
			<td><input type=text id=kod name=kod value="" ondblclick=this.value='' style="margin-top: 3px;"></td>
			</tr>
			<tr>
			<td>ISIM:</td>
			<td><input type=text id=ad name=ad value="" ondblclick=this.value='' width="250" style="width: 250px;margin-top: 3px;"></td>
			</tr>
			<tr>
			<td>MİKTAR:</td>
			<td><input type=text id=miktar name=miktar value="" ondblclick=this.value='' style="margin-top: 3px;"></td>
			</tr>
			<tr>
			<td>DAT FIYAT:</td>
			<td><input type=text id=datfiat name=datfiat value="" style="margin-top: 3px;"></td>
			</tr>
			<tr>
			<td>BAKİYE:</td>
			<td><input type=text id=bakiye name=bakiye value='' readonly="true" style="width: 50px;margin-top: 3px"></td>
			</tr>
			<tr><td><label>&nbsp;</label></td></tr>
			<tr><td><label>&nbsp;</label></td></tr>
			</table>
		</div>
		<div class=element>
			<label>sayim_stk</label>
			<select name="stklist" id="stklist" class="txt"style="width: 90px;" > 
			{% for har in hardos %}<option>{{har[0]}}</option>{% endfor %}
			</select>
			
			<select id="guncelsira"	name="guncelsira" tabindex="-1">
				<option value="yeni" selected>yeni</option>
			</select>
			<input type="submit" name="stkYenile" id="stkYenile" value="Yenile" tabindex="-1"/>
			<input type="submit" name="stkSatirSil" id="stkSatirSil" value="Satır Sil" tabindex="-1"/>
			<input type=text id=fkod name=fkod hidden value={{fkod}} >
			<input id="stksecim" name="stksecim" type="hidden" value="" />
			<input id="modulAd" name="modulAd"  hidden value="sayim" />
		</div>	

		<hr noshade size=2>
	
	
		<div class=element>
			<input type="submit" name="yeniStk" id="yeniStk" value="YENİ SAYIM" />
		</div>
		<div class=element>
			
			<label>Tarih:</label> <input type="text" class="txt" name="sayimTarih" id="sayimTarih" style="margin-left: 32px; width: 80px;"/><p>
			<label>Yer:</label> <input type=text id=sayimCari name=sayimCari value="" style="margin-left: 47px; width: 150px;"><p>
			<label>Satış Yer:</label> <input type=text id=satisCari name=satisCari class="hover" hinttext="Satış Yaplacak Yer" value="" style="margin-left: 0px; width: 150px;">
			<input type="submit" name="sayimHazirla" id="sayimHazirla" class="button gray medium" value="HAZIRLA" /><p>
		</div>
		<div class=element>
			<input type="submit" name="stokSifirla" id="stokSifirla" class="button gray medium" value="STOK SIFIRLA" />
			<select  type=text id=kriter name=kriter value="{{kriter}}" >
			  <option>{{kriter}}</option>
			  <option>STOK_KODU</option>
			  <option>STOK_ADI</option>
			  <option>KOD_1</option>
			  <option>KOD_2</option>
			  <option>KOD_3</option>
			  <option>SATICI_KODU</option>
			  <option>BARKOD1</option>
			  <option>BARKOD2</option>
			  <option>BARKOD3</option>
			  </select>
			  -><input type=text id=arama name=arama value="{{arama}}" style="margin-right: 2px; width: 90px;">
		</div>
		<div class=element>
			<input type=file title="dosya sec" id=sdosya name=sdosya>
			<input type=submit id=dosYukle name=dosYukle value='dosyadan sıfırla'>
		</div><br>
		<input type="submit" name="shSifirlama" id="shSifirlama" class="button gray medium" value="SAYIM HARİÇ SIFIRLAMA" /><p>
	</div>
	<div id='genelalan' class="genelalan" tabindex="-1">
		<div class=raporalan id=raporalan>
		ilgili rapor alani	
		</div>
		<div id="hintbox"></div>
		<hr noshade size=1>
		<div id="fsb"></div>
	</div>
</div>
</body>
</HTML>
